<?php
namespace Wap\Model;
use Think\Model;

class EnrollModel extends Model
{
    protected $tableName = "enroll";

    public function isExistAndTime( $enroll = -1 )
    {
        $condition['id'] = $enroll;
        $now = time();
        $condition['begin_time'] = array( "lt", $now );
        $condition['end_time'] = array( "gt", $now );


        $found = $this->where( $condition )->find();
        return $found;
        /*if( !$found ){
            return 0;
        }else{
            return 1;
        }*/
    }
}
